package cate.game.pvp.eliterace.handler;

import cate.game.pvp.eliterace.data.EliteRaceRankRwd;
import cate.game.role.RoleSnapshot;
import lombok.Data;

import java.util.List;

public interface EliteRaceRankRwdOperation {

    void lamp(RoleSnapshot snapshot);

    void upsert(List<EliteRaceRankRwd> rankRwdList);

    @Data
    class QueryParam {
        private int season;
        private int srvId;

        public static QueryParam of(int season, int srvId) {
            QueryParam param = new QueryParam();
            param.setSeason(season);
            param.setSrvId(srvId);
            return param;
        }

        public String getIndexedKey() {
            return String.format("%d-%d", season, srvId);
        }
    }

    List<EliteRaceRankRwd> query(QueryParam param);
}
